package com.javasm.bootdemo.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author javasm
 * @version 0.1
 * @className R
 * @descriptioin:
 * @date 2024/12/30 15:00
 * @since jdk11
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class R {

    private Integer code;
    private String msg;

    private Object data;

    public R(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static R ok(){

        return new R(200,"success");
    }

    public static R ok(Object data){

        return new R(200,"success",data);
    }


}
